﻿module Sustainalytics.Portfolio {
    import Common = Sustainalytics.Common;
    import SearchBox = Sustainalytics.SearchBox;

    // Portfolio List controller
    export class PortfolioCheckController {

        public resultCheck: boolean;

        // Ctor.
        constructor(
            private $rootScope: ng.IScope,
            private $scope: ng.IScope,
            private $q: ng.IQService,
            private $location: ng.ILocationService,
            private PortfolioService: PortfolioService,
            private notificationFactory: Common.INotificationFactory,
            private $modal: Common.IModal,
            private $modalInstance: Common.IModalInstance,
            public message: string,
            public informationMessage: string) {

            var ctx = this;
            $scope['portfolioCheck'] = ctx;
        }

        public closeDialog = function () {
            this.$modalInstance.close({ portfolioCheck: false });
        };

        public updatePortfolio() {
            this.$modalInstance.close({ portfolioCheck: true });
        }
    }


    // register controller with News Angular module
    angular.module(portfolioModuleName).controller('PortfolioCheckController',
        ['$rootScope', '$scope', '$q', '$location', 'PortfolioService', 'notificationFactory', '$modal', '$modalInstance', 'message', 'informationMessage', PortfolioCheckController]);
}
